<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        let arr = [524, 633, 777, 82, 99, 422, 7778, 20, 6, 44, 523]
        let arr2 = []
        arr.map(function (item) {
            if (item > 300) {
                arr2.push(item)
            }
        })
        console.log(arr2)
        const sum = arr2.reduce(function (prve, item) {
            return prve += item
        }, 0)
        console.log(sum)
    </script>
</body>

</html>